package com.yitiao.demo100;

/**
 * 计算给定整数12345的各数字的和。
 */
public class question_07 {
    public static void main(String args[]) {
        int y = 12345;
        int r = 0 ;
        int sum = 0;
        while(y!=0) {
            r = y % 10;
            sum += r;
            y = y / 10;
        }
        System.out.println("y = " + sum);
    }
}
